#/user/bin/python3
# -*- coding:utf-8 -*-

from oslo_config import cfg
import sys

soft_pach= sys.path[0] + '/conf'
CLIENT_OPTS = [
    cfg.StrOpt('ClientHostUser',default='root',help='it is best to use the root user'),
    cfg.StrOpt('ClientHostPasswd',default='000000',help='client host password')
]

API_OPTS = [
    cfg.IPOpt('BindHost',default='0.0.0.0',help='The listen IP for the  API server'),
    cfg.PortOpt('BindPort',default='8090',help='The port for the API server')
]
SQL_OPTS = [
    cfg.StrOpt('SQLSwitch',default='false',help='Select whether to enable writing test results to the database'),
    cfg.IPOpt('SQLServerIP',default='127.0.0.1',help='Database node IP address'),
    cfg.StrOpt('SQLServerUser',default='root',help='Database user'),
    cfg.StrOpt('SQLServerPasswd',default='000000',help='Database password'),
    cfg.StrOpt('SQLServerDatabase',default='sw',help='Database name')
]
LOG_OPTS = [
    cfg.StrOpt('Log_File',default=soft_pach + 'sw_test.log' ,help='The file path to which the log is output'),
]

CONF=cfg.CONF


CLIENT_OPT_GROUP = cfg.OptGroup(name='CLIENT',title='Client Host')
CONF.register_group(CLIENT_OPT_GROUP)
CONF.register_opts(CLIENT_OPTS,CLIENT_OPT_GROUP)

API_OPT_GROUP = cfg.OptGroup(name='API',title='API server')
CONF.register_group(API_OPT_GROUP)
CONF.register_opts(API_OPTS,API_OPT_GROUP)

SQL_OPT_GROUP = cfg.OptGroup(name='SQL',title='Database')
CONF.register_group(SQL_OPT_GROUP)
CONF.register_opts(SQL_OPTS,SQL_OPT_GROUP)

LOG_OPT_GROUP = cfg.OptGroup(name='LOG',title='LOG')
CONF.register_group(LOG_OPT_GROUP)
CONF.register_opts(LOG_OPTS,LOG_OPT_GROUP)

CONF(default_config_files=[ soft_pach +"/qc_storage.conf"])



# print(CONF.CLIENT.ClientHostUser)
# print(CONF.CLIENT.ClientHostPasswd)
# print(CONF.API.BindHost)
# print(CONF.API.BindPort)
# print(CONF.SQL.SQLSwitch)
# print(CONF.SQL.SQLServerIP)
# print(CONF.SQL.SQLServerUser)
# print(CONF.SQL.SQLServerPasswd)
# print(CONF.SQL.SQLServerDatabase)
# print(CONF.LOG.Log_File)
